﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace MIS.Component
{
    public delegate void ItemEvent(string TextValue);
    public delegate void DoWorkEventHandler(object sender, EventArgs e);
    public partial class numButton : UserControl
    {

        public event ItemEvent ItemEventHandle;
        public event DoWorkEventHandler ItemDialEventHandle;
        public event DoWorkEventHandler ItemCancleEventHandle;

        public numButton()
        {
            InitializeComponent();  
        }

        private string _Text="";

        private void GetTextValue()
        {
            if (ItemEventHandle != null)
            {
                ItemEventHandle(_Text);
            }       
        }
       
       
        private void J_Click(object sender, EventArgs e)
        {
            Button bt = (Button)sender;
            _Text = bt.Text;
            GetTextValue();
        }

        private void button_dial_Click(object sender, EventArgs e)
        {
            Button bt = (Button)sender;
            _Text = bt.Text;
            if (ItemDialEventHandle != null)
            {
                ItemDialEventHandle(sender, e);
            }    
        }

        private void button_cancle_Click(object sender, EventArgs e)
        {
            Button bt = (Button)sender;
            _Text = bt.Text;
            if (ItemCancleEventHandle != null)
            {
                ItemCancleEventHandle(sender, e);
            }    
        }

     
    }
}